Skip to content

gh-109802: removed inaccessible code from complexobject.c#109642

Closed
skirpichev wants to merge 56 commits intopython:mainfrom
skirpichev:complex-cov
Closed

gh-109802: removed inaccessible code from complexobject.c#109642
skirpichev wants to merge 56 commits intopython:mainfrom
skirpichev:complex-cov

Conversation

@skirpichev
Copy link
Member

@skirpichev skirpichev commented Sep 21, 2023

  • c_powu: L189 (c_powu() called with n < 100 and mask can't overflow)
  • complex_hash: L459, L462 (in current implementation of hashing, -1 is reserved)
  • complex_richcompare: L643, L669 (TO_COMPLEX calls are redundant)
  • complex_subtype_from_string: L892 (complex_subtype_from_string() helper called only on L949 with unicode object at v)
  • actual_complex_new: L960 (PyComplex_Check can't be true here), L960 (test added)
  • complex_new_impl: L1028 (test added)
  • complex_new_impl: L1034 (here r is not a complex subtype, hence above try_complex_special_method() call was unsuccessful)
  • complex_new_impl: L1068 (here r is a complex subtype, hence own_r==1)
  • complex_from_number: L1150 (test added)

Line numbers are wrt to complexobject.c at 8a284e189673582e2.


Everything (except for memory errors) should be covered by tests in test_complex.py and test_capi/test_complex.py.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants